# 计算两个rect对象之间的坐标差

def two_rects(r1, r2):
    x1 = r1.x
    x2 = r2.x
    y1 = r1.y
    y2 = r2.y
    return x2 - x1, y2 - y1

if __name__ == '__main__':
    import pygame
    r1 = pygame.Rect(20,30,100,100)
    r2 = pygame.Rect(20,30,100,100)
    print(two_rects(r1, r2))
